﻿using Sunboxsoft.ASMS.WebUtility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace Sunboxsoft.ASMS.Web
{
    public class ASMSController : Controller
    {
        public ActionResult ActualBusinessView()
        {
            ViewBag._BusinessName = WebUtility.CookieUtility.GetBusinessName();
            ViewBag._UserName = WebUtility.CookieUtility.GetUserName();
            return View(RouteData.Values["action"].ToString(), "~/Areas/ASMS/Views/Shared/_layout_business.cshtml");
        }
        public ActionResult AcutalAdminView()
        {
            ViewBag._UserName = WebUtility.CookieUtility.GetUserName();
            return View(RouteData.Values["action"].ToString(), "~/Areas/ASMS/Views/Shared/_layout_admin.cshtml");
        }

        public ActionResult BusinessView()
        {
            if (CookieUtility.GetBusinessId() == null)
            {
                return RedirectToAction("DenyAdmin", "Home");
            }
            ViewBag._BusinessName = WebUtility.CookieUtility.GetBusinessName();
            ViewBag._UserName = WebUtility.CookieUtility.GetUserName();
            return View(RouteData.Values["action"].ToString(), "~/Areas/ASMS/Views/Shared/_layout_business.cshtml");
        }

        public ActionResult AdminView()
        {
            if (CookieUtility.GetBusinessId() != null)
            {
                return RedirectToAction("DenyBusiness", "Home");
            }
            ViewBag._UserName = WebUtility.CookieUtility.GetUserName();
            return View(RouteData.Values["action"].ToString(), "~/Areas/ASMS/Views/Shared/_layout_admin.cshtml");
        }
    }
}
